package com.wzb.mybatisplus.bitaction;

import com.wzb.mybatisplus.entity.Bituse;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ForkJoinPool;

/**
 * 档案线程池
 * @author lcr
 * @since 2023-05-01 13:33
 */
public class ArchiveThreadPool {

    private ArchiveThreadPool(){

    }

    private static class ThreadPoolHolder{
        private static ExecutorService threadPool = Executors.newFixedThreadPool(4);
    }

    private static class ForkJoinPoolHolder{
        private static ForkJoinPool forkjoinPool = new ForkJoinPool();
    }

    public static ExecutorService getThreadPoolInstance(){
        return ThreadPoolHolder.threadPool;
    }

    public static ForkJoinPool getForkJoinPoolInstance(){
        return ForkJoinPoolHolder.forkjoinPool;
    }

    public static void main(String[] args) {



        ArchiveThreadPool.getThreadPoolInstance().execute(()->{
            if(BitcoinWIFConverter.wifTo34CharPublicKey("1").equals("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa")){
//                                sum=sum+1;
//                                System.out.println("============="+sum + "      秘钥" +maney1);
//               if(true){
                Bituse bituse = new Bituse();
                bituse.setWifsy("12");
                bituse.setGy("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa");

            }
        });

    }
}
